<%@ page language="java" import="java.util.*,com.tandi.menu.*" pageEncoding="UTF-8"%>
<%@ include file="/include/jstl.jsp" %>

<link  href="${pageContext.request.contextPath}/css/zTreeStyle/zTreeStyle.css"  rel="stylesheet" type="text/css" />
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery.ztree.core-3.0.js"></script>
<script type="text/javascript"  src="${pageContext.request.contextPath}/js/jquery.ztree.excheck-3.0.js"></script>
<%
    java.util.HashMap etf = (java.util.HashMap)request.getAttribute("ETF");
    java.util.ArrayList list = (java.util.ArrayList)etf.get("MENU");
  
    java.util.List  melist=list;
    if(list != null && list.size()>0){
        melist = MenuUtils.genMenuStr(list, null);
     }
          String CUST_CARD_DATE = request.getParameter("CUST_CARD_DATE");
     
%>
<script type="text/javascript">
      function callback(msg){        
        var m= msg; 
        if(msg==""){
            //alert("系统错误！");
            $("#msg").html("系统错误！");
          };  
        var arr=msg.split(',');
        var stateStus=arr[0];
        switch(stateStus){
           case 'F':
             //alert("上传文件失败！");
            $("#msg1").html("上传文件失败！");
            $("#msg2").html("上传文件失败！");
            $("#msg3").html("上传文件失败！");
             break; 
           case 'G':
             //alert("上传文件失败！");
            $("#msg1").html("您上传的图片不可用!");
            $("#msg2").html("您上传的图片不可用!");
            $("#msg3").html("您上传的图片不可用!");
             break;
           case 'S':
              if(arr[1]=='2'){//两个文件上传
                $("#FILENAME1S").attr("value",arr[2]);
                $("#FILENAME2S").attr("value",arr[3]);
                if(numPh==1){
                  $("#deBtDiv1").show(); 
                }else if(numPh==2){
                  $("#deBtDiv1").show();
                  $("#deBtDiv2").show();  
                }
                }else{ //一个文件上传 
                    $("#FILENAME1S").attr("value",arr[2]);
                    $("#deBtDiv1").show();
                  }
    
              document.getElementById("upload").disabled=true;
              document.getElementById("bt1").disabled=false;
              document.getElementById("bt2").disabled=false;
             // alert("上传成功");
            $("#msg1").html("上传成功！");
            $("#msg2").html("上传成功！");
            $("#msg3").html("上传成功！");
            
              break;
           case 'C':
             // alert("上传文件文件过大！");  
            $("#msg1").html("上传文件文件过大！");  
            $("#msg2").html("上传文件文件过大！");  
            $("#msg3").html("上传文件文件过大！");  
              break;
           case 'T':
         //     alert("上传文件格式错误！");
            $("#msg1").html("上传文件格式错误！"); 
            $("#msg2").html("上传文件格式错误！"); 
            $("#msg3").html("上传文件格式错误！"); 
              break;
        
        }
       
      } 

      function carddate(){
         var sCUST_CARD_DATE = $("#CUST_CARD_DATE").val();
         var sHref = $("#ss").attr("href");
           if(sHref.indexOf("&CUST_CARD_DATE=")!=-1){
             var iIndex = sHref.indexOf("&CUST_CARD_DATE=");
             sHref = sHref.substr(0,iIndex);
           }
         $("#ss").attr("href",sHref+"&CUST_CARD_DATE="+sCUST_CARD_DATE);
         //alert(sHref+"&CUST_CARD_DATE="+sCUST_CARD_DATE);
      }
      function chooseDate(){
          document.getElementById("CUST_CARD_DATE").style.display="block";
          document.getElementById("timegeshi").style.display="block";
          $("#CUST_CARD_DATE").val('');
      }
      function choose(){
          document.getElementById("CUST_CARD_DATE").style.display="none";
          document.getElementById("timegeshi").style.display="none";
          var sCUST_CARD_DATE ='20990101';
          var sHref = $("#ss").attr("href");
          if(sHref.indexOf("&CUST_CARD_DATE=")!=-1){
               var iIndex = sHref.indexOf("&CUST_CARD_DATE=");
               sHref = sHref.substr(0,iIndex);
           }
         $("#ss").attr("href",sHref+"&CUST_CARD_DATE="+sCUST_CARD_DATE);
          //alert(sHref+"&CUST_CARD_DATE="+sCUST_CARD_DATE);
      }
      
      function submitbut(){
          var sHref = $("#kk").attr("href");
          sHref="412213.stp?CUST_ID=${ETF.CUST_ID}&USR_STATUS=3";
          if(sHref.indexOf("&REMARK=")!=-1){
               var iIndex = sHref.indexOf("&REMARK=");
               sHref = sHref.substr(0,iIndex);
          }
          $("#kk").attr("href",sHref+"&REMARK="+encodeURIComponent(encodeURIComponent($("#REMARK").val())));
      }
      
      //图片显示整体缩小 不到此大小显示原图
      function AutoResizeImage(maxWidth,maxHeight,objImg){
         var img = new Image();
         img.src = objImg.src;
         var hRatio;
         var wRatio;
         var Ratio = 1;
         var w = img.width;
         var h = img.height;
         wRatio = maxWidth / w;
         hRatio = maxHeight / h;
         if (maxWidth ==0 && maxHeight==0){
         Ratio = 1;
         }else if (maxWidth==0){//
         if (hRatio<1) Ratio = hRatio;
         }else if (maxHeight==0){
         if (wRatio<1) Ratio = wRatio;
         }else if (wRatio<1 || hRatio<1){
         Ratio = (wRatio<=hRatio?wRatio:hRatio);
         }
         if (Ratio<1){
         w = w * Ratio;
         h = h * Ratio;
         }
         objImg.height = h;
         objImg.width = w;
      }
</script>

<h2 class="contentTitle" style="background-color:#E8F1FD;">用户身份信息详情</h2>
  <div class="pageContent"  style="background-color:#E8F1FD;">
   <form id="formsmill" action=""  method="post" enctype="multipart/form-data" target="uploadIframe" onsubmit="return iframeCallback(this)" >
     <div class="pageFormContent" layoutH="95">
       <div class="unit">
        <label>用户编号：</label>
         <input type="text" size="50" name="CUST_ID" id="CUST_ID" value="${ETF.CUST_ID}"  readonly />
       </div>
       
       <div class="unit">
        <label>用户名称：</label>
        <input type="text" size="50" name="CUST_NAME" id="CUST_NAME" value="${ETF.CUST_NAME}"  readonly />
       </div>
       
       <div class="unit">
        <label>登录账号：</label>
        <input type="text" size="50" name="CUST_LOGIN" id="CUST_LOGIN" value="${ETF.CUST_LOGIN}"  readonly />
       </div>
       
       <div class="unit">
           <label>证件类型：</label>
           <input type="text" size="50" name="CUST_CRED_TYPE" id="CUST_CRED_TYPE" 
           <c:if test="${ETF.CUST_CRED_TYPE=='0'}">value="居民身份证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='1'}">value="护照"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='2'}">value="军官证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='C'}">value="台湾居民身份证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='F'}">value="临时身份证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='G'}">value="警察证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='I'}">value="港澳身份证"</c:if>
          <c:if test="${ETF.CUST_CRED_TYPE=='Z'}">value="其他"</c:if>
           readonly />
       </div>
             
       <div class="unit">
          <label>证件号码：</label>
          <input type="text" size="50" name="CUST_CRED_NO" id="CUST_CRED_NO" value="${ETF.CUST_CRED_NO}" readonly />
       </div>
       <c:if test="${ETF.USR_STATUS=='2'}">
       <div class="unit">
          <label> 证件有效期：</label>
          <dt><input id="all_0"  name= "LIMIT_START_TYPE"   type="radio" onclick="choose();" value="0" disabled /> 永久
          <input id="notall_0"  name="LIMIT_START_TYPE"  type="radio"  onclick="chooseDate();" value="1" checked disabled/> 按时间 </dt>
          <dt><input type="text" size="15" maxlength="8" style="display: block" value="${ETF.CUST_CARD_DATE}" name="CUST_CARD_DATE" id="CUST_CARD_DATE" onchange="carddate()" class="required number" value=""  disabled/></dt><span id="timegeshi" style="display: block">时间格式:20130901</span>
       </div>
       </c:if>
       <c:if test="${ETF.USR_STATUS=='1'}">
       <div class="unit">
          <label> 证件有效期：</label>
          <dt><input id="all_0"  name= "LIMIT_START_TYPE"   type="radio" onclick="choose();" value="0"  /> 永久
          <input id="notall_0"  name="LIMIT_START_TYPE"  type="radio"  onclick="chooseDate();" value="1" checked /> 按时间 </dt>
          <dt><input type="text" size="15" maxlength="8" style="display: block" value="${ETF.CUST_CARD_DATE}" name="CUST_CARD_DATE" id="CUST_CARD_DATE" onchange="carddate()" class="required number" value=""  /></dt><span id="timegeshi" style="display: block">时间格式:20130901</span>
       </div>
       </c:if>
       
       <div class="unit">
          <label>注册日期：</label>
          <input type="text" size="50" name="CUST_REG_DATE" id="CUST_REG_DATE" value="${ETF.CUST_REG_DATE}" readonly />
       </div>
       <c:if test="${ETF.USR_STATUS=='2'}">
		       <div class="unit">
		          <label>认证操作员：</label>
		          <input type="text" size="50" name="ADMIN_ID" id="ADMIN_ID" value="${ETF.ADMIN_ID}" readonly />
		       </div>
		       
		       <div class="unit">
		          <label>认证日期：</label>
		          <input type="text" size="50" name="ADMIN_DATE" id="ADMIN_DATE" value="${ETF.ADMIN_DATE}" readonly />
		       </div>
       </c:if>
       <div class="unit">
        <label>认证状态：</label>
           <select name="USR_STATUS" id="USR_STATUS" disabled >
             <option value="0" <c:if test="${ETF.USR_STATUS=='0'}">selected="selected"</c:if>> 证件到期</option>
             <option value="1" <c:if test="${ETF.USR_STATUS=='1'}">selected="selected"</c:if>> 审核中</option>
             <option value="2" <c:if test="${ETF.USR_STATUS=='2'}">selected="selected"</c:if>> 已通过</option>
             <option value="3" <c:if test="${ETF.USR_STATUS=='3'}">selected="selected"</c:if>> 未通过</option>
           </select>
      </div>
      
      <div class="unit">
           <label>公安部认证状态：</label>
           <select name="PUBLIC_STATUS" id="PUBLIC_STATUS" disabled >
             <option value="0" <c:if test="${ETF.PUBLIC_STATUS=='0'}">selected="selected"</c:if>> 未认证</option>
             <option value="1" <c:if test="${ETF.PUBLIC_STATUS=='1'}">selected="selected"</c:if>> 已通过</option>
             <option value="2" <c:if test="${ETF.PUBLIC_STATUS=='2'}">selected="selected"</c:if>> 未通过</option>
           </select>
      </div>
      
      <div class="unit">
        <label>公安部图片：</label>
        <c:if test="${ETF.PUBLIC_PHOTO=='dat/upload/'}"><img src="${pageContext.request.contextPath}/images/onShow.gif"  alt="公安部图片" /></c:if>
        <c:if test="${ETF.PUBLIC_PHOTO!='dat/upload/'}"><img src="${ETF.PUBLIC_PHOTO}"  alt="公安部图片" onload="AutoResizeImage(500,600,this)" /></c:if>
      </div>
      <!--
      <div class="unit">
         <label>身份证正面照片：</label>

         <c:if test="${ETF.CRED_PHOTO_FRONT=='dat/upload/'}"><img src="${pageContext.request.contextPath}/images/onShow.gif"  alt="身份证正面照片" /></c:if>
         <c:if test="${ETF.CRED_PHOTO_FRONT!='dat/upload/'}"><img src="${ETF.CRED_PHOTO_FRONT}?random=${ETF.RANDOM}"  alt="身份证正面照片" onload="AutoResizeImage(500,600,this)" /></c:if>
         <br/>
         <label>身份证反面照片：</label>
         <c:if test="${ETF.CRED_PHOTO_BACK=='dat/upload/'}"><img src="${pageContext.request.contextPath}/images/onShow.gif"  alt="身份证反面照片" /></c:if>
         <c:if test="${ETF.CRED_PHOTO_BACK!='dat/upload/'}"><img src="${ETF.CRED_PHOTO_BACK}?random=${ETF.RANDOM}"  alt="身份证反面照片" onload="AutoResizeImage(500,600,this)" /></c:if>
      </div>
      
       -->
        <c:forEach items="${ETF.ATTACHMENT}" var="attach">
           <c:if test="${attach.LX == 'SFZ'}">
               <div class="unit">
                   <c:if test="${attach.ORDERNUM == '1'}">
                        <label>身份证正面照片：</label>
                   </c:if>
                   <c:if test="${attach.ORDERNUM == '2'}">
                        <label>身份证反面照片：</label>
                   </c:if>
                   <input type="text" disabled="disabled" size="30" value="${attach.FJNAME}" name="FJNAME_${attach.LX}_${attach.ORDERNUM}" id="FJNAME_${attach.LX}_${attach.ORDERNUM}"/>
                   <!--<a class='btnAttach' title='上传附件' height='300' width='560' href='ATTA01.stp?PKID=${attach.PKID}&TABLENAME=${attach.TABLENAME}&LX=${attach.LX}&ORDERNUM=${attach.ORDERNUM}'>查找带回</a> -->
                   <a class='btnView'   title='预览'     height='600' width='680' lookupGroup='' href='ATTA03.stp?PATH=${attach.FJPATH}' id="FJSHOW_${attach.LX}_${attach.ORDERNUM}">预览</a>
                   <a class='btnAssign' title='下载附件' href='down.download?filepath=${attach.FJPATH}'>下载</a>
               </div>
           </c:if>
        </c:forEach>
       
       <div class="unit">
         <label >审核意见：</label>
         <textarea name="REMARK" id="REMARK" value="" maxlength="100" cols="40" rows="5"  class="required"   >${ETF.REMARK }</textarea>
       </div>
       
  </div>
    <div class="formBar" >
      <ul>
				<c:if test="${ETF.FLAG == 1 }">
				 <li <c:if test="${ETF.USR_STATUS == 3 ||ETF.USR_STATUS == 0 || ETF.USR_STATUS == 2 }">style="display:none"</c:if>><a  class="buttonActive" id="ss" target="navTab" href="412213.stp?CUST_ID=${ETF.CUST_ID}&USR_STATUS=2&CUST_CRED_TYPE=${ETF.CUST_CRED_TYPE}&CUST_CRED_NO=${ETF.CUST_CRED_NO}&REMARK=${ETF.REMARK}"> <div class="buttonContent"><button type="button" id="bt1" <c:if test="${ETF.SEND_TYPE==2||ETF.SEND_TYPE==3}">disabled="true"</c:if>>认证通过</button></div></a></li>          
				 <li <c:if test="${ETF.USR_STATUS == 3 ||ETF.USR_STATUS == 0 || ETF.USR_STATUS == 2 }">style="display:none"</c:if>><a  class="buttonActive" id="kk" target="navTab" href="javascript:void(0);" onclick="submitbut()" > <div class="buttonContent"><button type="button" id="bt2" <c:if test="${ETF.SEND_TYPE==2||ETF.SEND_TYPE==3}">disabled="true"</c:if>>认证未通过</button></div></a></li>  
        </c:if>
        <li><div class="button"><div class="buttonContent"><button type="button" class="close">关闭</button></div></div></li>
      </ul>
    </div>
       
  </form>
  <iframe name="uploadIframe" id="uploadIframe" style="display:none"></iframe> 
  
 
</div>